[Docs] Fix python specifiers in tutorials#19280
[Docs] Fix python specifiers in tutorials#19280vacu9708 wants to merge 1 commit intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19280
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below:
|
|
Hi @vacu9708! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
This PR needs a
|
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
The tutorial pages prescribe 'python=3.10.0', which has a CPython bug (python/cpython#89683) that leaves PyTorch's LeafSpec's init=False fields uninitialized. run_decompositions() in ExecuTorch deepcopies the LeafSpec nodes and crashes, so any model export attempt fails unconditionally on Python 3.10.0. The CI pipeline uses PYTHON_VERSION=3.10 in .ci/docker/build.sh, which conda resolves to the latest 3.10.x (currently 3.10.16) — unaffected by the bug. This fix aligns the docs with CI.
a645615 to
cdf8891
Compare
|
Sorry I included a wrong additional commit by mistake and the CI failed. I'd like to request the approval again. |
Fixes #18073 (This issue was already fixed before this PR)
Problem
The setup tutorial prescribes:
This version has a CPython bug that leaves PyTorch's LeafSpec's init=False
fields uninitialized. run_decompositions() in ExecuTorch deepcopies the
LeafSpec nodes and crashes.
This breaks the export pipeline (
to_edge_transform_and_lower,to_edge,run_decompositions),which leads to any model export attempt failing unconditionally on Python 3.10.0.
Upstream Fix Status
The fix has already landed in PyTorch
mainvia pytorch/pytorch#177154 and is available in recent nightly builds.However, ExecuTorch currently pins to
torch==2.11.The 2.11 branch was cut before the fix was merged, which means
the upstream fix does not apply until the ExecutTorch's torch pin is bumped to 2.12.
Until then, this PR is necessary to prevent tutorial followers from hitting the bug and getting lost.
Resolution
The CI build script (
.ci/docker/build.sh) uses:conda interprets
python=3.10as a prefix, installing the latest available3.10.x — currently 3.10.16 — which does not have this bug.
The CPython fix landed in 3.10.1.
This discrepancy (
3.10vs3.10.0) makes the bug invisible to CI while affecting any user who follows the setup tutorial.Fix python=3.10.0 -> python=3.10 to align the docs with CI.
Test plan
Not working
Working